package com.yang.provider.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.util.Date;

@Data
public class Product {

    @TableId(value = "product_id",type = IdType.AUTO)
    private Long productId;

    private String productName;

    private String price;

    private String productDesc;

    private String fileUrl;

    private Date createTime;

    private Date updateTime;

    private Integer isDelete;

    private Integer status;

    /**
     * 字段名称枚举.
     */
    public enum FieldNames {
        productId("productId", "product_id"),
        productName("productName", "product_name"),
        price("price", "price"),
        productDesc("productDesc", "product_desc"),
        fileUrl("fileUrl", "file_url"),
        createTime("createTime", "create_time"),
        updateTime("updateTime", "update_time"),
        isDelete("isDelete", "id_delete"),
        status("status", "status");

        private String fieldName;

        private String tableFieldName;

        FieldNames(String fieldName, String tableFieldName) {
            this.fieldName = fieldName;
            this.tableFieldName = tableFieldName;
        }

        public String getFieldName() {
            return fieldName;
        }

        public String getTableFieldName() {
            return tableFieldName;
        }
    }


}
